init.js ➔ ... ➔ ???   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
c 2
b 0
f 0
nc 1
dl 0
loc 6
nop 0
rs 10
1
import { initAutoMetrics, getMetricsInstance } from '../init';
2
3
describe('initAutoMetrics', () => {
4
	it('would store the metrics instance that can be got', () => {
5
		const instance = { foo: 'bar' };
6
		initAutoMetrics(instance);
7
		const metrics = getMetricsInstance();
8
		expect(metrics).toBe(instance);
9
	});
10
});
11
12
describe('getMetricsInstance', () => {
13
	it('should repeatedly get the stored instance after init', () => {
14
		const instance = { foo: 'bar' };
15
		initAutoMetrics(instance);
16
		expect(getMetricsInstance()).toBe(instance);
17
		expect(getMetricsInstance()).toBe(instance);
18
	});
19
});
20